package com.example.commons.analysis;

import com.example.commons.exception.BusinessException;
import com.example.commons.response.ResponseResult;
import com.example.commons.response.ResultCode;
import lombok.extern.slf4j.Slf4j;

/**
 * 解析远程调用返回参数
 */

@Slf4j
public class ApiParse {

    public static void parse(ResponseResult result) {
        log.info("返回结果：" + result);
        if (ResultCode.SUCCESS != result.getCode()) {
            throw new BusinessException(result.getMsg());
        }
    }
}
